/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.base.manager.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xy.biz.base.domain.bo.CorpBO;
import com.xy.biz.base.domain.query.CorpQuery;
import com.xy.biz.base.domain.converter.CorpConverter;
import com.xy.biz.base.manager.CorpManager;
import com.xy.biz.base.dao.CorpDao;

/**
 * 
 * 
 * @author zsp
 * @date 2020-9-3
 */
@Service
public class CorpManagerImpl implements CorpManager {

	@Autowired
	private CorpDao corpDao;
	
	@Override
	public int saveCorp(CorpBO corpBO) {
		return corpDao.saveCorp(CorpConverter.toPO(corpBO));
	}
	
	@Override
	public int updateCorp(CorpBO corpBO) {
		return corpDao.updateCorp(CorpConverter.toPO(corpBO));
	}
	
	@Override
	public int deleteCorp(Long corpId) {
		return corpDao.deleteCorp(corpId);
	}
	
	@Override
	public CorpBO getCorp(Long corpId) {
		return CorpConverter.fromPO(corpDao.getCorp(corpId));
	}
	
	@Override
	public List<CorpBO> listCorpById(Collection<Long> collection) {
		return CorpConverter.fromPO(corpDao.listCorpById(collection));
	}
	
	@Override
	public List<CorpBO> listCorp(CorpQuery query) {
		return CorpConverter.fromPO(corpDao.listCorp(query));
	}
	
	@Override
	public int countCorp(CorpQuery query) {
		return corpDao.countCorp(query);
	}
	
}
